1. Technical Field
Embodiments of the invention relate generally to graphical application development environment, and more particularly to slicing and scaling of figures.
2. Discussion of Prior Art
Over a period of time use of graphical applications has increased tremendously. In graphical applications such as web designing, animation or movies it is often desired to change size of figures. Normal scaling of a figure results in an unpleasant graphical effect. The normal scaling of the figure leads to magnification of edges and corners which then become noticeably altered. For example, FIG. 1 illustrates a rectangle 102 with rounded corners and dimension (scale x=150, scale y=100). Rounded corners of rectangle 102, for example, rounded corner 112, have an aspect ratio of 1:1. The aspect ratio is width to height ratio. Rectangle 102 when scaled 2 times in the x direction and 4 times in the y direction normally, results in a jagged appearance as shown in a corner 108 of a normally scaled rectangle 104 of FIG. 1. Further, the aspect ratio of the rounded corners, for example, rounder corner 108, is also altered to 1:2 (2:4).
A developer uses various graphical tools to edit figures in graphical applications. One existing method that is used in web designing includes dividing the figure into nine sections by slicing it with a grid including two sets of perpendicular intersecting parallel lines. Specific ones of the nine sections are then scaled or transformed according to the grid in which they are located. This approach is referred to as “nine slice scaling”, “nine scaling”, “scale nine” or “slice nine”. The nine slice scaling approach is applicable to both bitmap and vector figures.
In an example method of nine slice scaling, a middle section out of the nine sections is scaled normally. Top and bottom sections to the middle section are scaled in horizontal direction only. Left and right sections to the middle section are scaled in vertical direction only. Four corner sections out of the nine sections are never scaled. For example, rectangle 102 of FIG. 1 with rounded corners and dimension (scale x=150, scale y=100) when scaled 2 times in the x direction and 4 times in the y direction using the nine slice scaling, results in an odd appearance with unscaled rounded corners, for example, unscaled rounded corner 110 as shown in a nine slice scaled rectangle 106 of FIG. 1. Further, border pixels of the figure get affected and look very different. Moreover, in complex figures including many graphics the graphics also get distorted. For example, graphic 114 (shape “X”) of rectangle 102 gets distorted to graphic 116. Also, nine slice scaling is not useful in case the figure is a rounded star or a rounded pentagon or of an irregular shape. In case the figure includes editable text, the text is also not scaled. Unscaled text also results in a less pleasant graphical effect. The graphical effect of unscaled text worsens, in cases where the figure is scaled unevenly, for example, when the difference between scale x and scale y is large.
Another existing technique that is used in web designing includes dividing the figure into three sections by slicing it with a grid including two parallel lines either in a horizontal direction or in a vertical direction. Specific ones of the three sections are then scaled or transformed according to the grid in which they are located. This approach is referred to as “three slice scaling”, “three scaling”, “scale three” or “slice three”. The three slice scaling approach is applicable to both bitmap and vector figures. However, drawbacks of three slice scaling are similar to those encountered in nine slice scaling.
In light of the foregoing discussion there is a need for a method and system for an efficient scaling of figures.